package org.weed.remote.ui;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

public class ImagePanel extends JPanel {
	private Image image;
	private Dimension size;
	
	public void setScreen(Image image) {
		this.image = image;
	}
	
	public void setSize(int width, int height) {
		size = new Dimension(width, height);
	}
	
	@Override
	public void paint(Graphics g) {
		g.drawImage(image, 0, 0, this);
	}
	
	@Override
	public Dimension getPreferredSize() {
		return size; 
	}
	
	public void paint(Graphics g, BufferedImage image) {
		g.drawImage(image, 0, 0, this);
	}

}
